package com.io.exception;


import com.io.vo.ApiResultEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * 自定义异常
 *
 * @author 郭冬冬
 * @version 1.0
 */
@Setter
@Getter
public class SelfException extends RuntimeException {
    /**
     * 响应码
     */
    private Integer code;

    public SelfException(ApiResultEnum apiResultEnum) {
        super(apiResultEnum.getMessage());
        this.code = apiResultEnum.getCode();
    }

    public SelfException(String message) {
        super(message);
    }

    public SelfException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
